import org.omg.CORBA.portable.OutputStream;

import java.io.*;

public class TransformStream {
    public static void main(String[] args) {
        try {
            FileInputStream inputStream = new FileInputStream("char_file.txt");

            InputStreamReader reader = new InputStreamReader(inputStream);

            FileOutputStream outputStream = new FileOutputStream("output.txt");
            OutputStreamWriter writer = new OutputStreamWriter(outputStream);

            BufferedReader bufferedReader = new BufferedReader(reader);
            BufferedWriter bufferedWriter = new BufferedWriter(writer);

            String line;
            while ((line = bufferedReader.readLine()) != null) {
                bufferedWriter.write(line);
                bufferedWriter.newLine();
            }

            bufferedReader.close();
            bufferedWriter.close();
            reader.close();
            writer.close();
            inputStream.close();
            outputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
